<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>图片标签列表</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="admin.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" href="../module/inventory/css/admin/index.css" />
<script type="text/javascript" src="../script/jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="../module/inventory/scripts/yui/yahoo-dom-event/yahoo-dom-event.js" ></script>
<script type="text/javascript" src="../module/inventory/scripts/yui/dragdrop/dragdrop-min.js" ></script>
<script type="text/javascript" src="../module/inventory/scripts/yui/calendar/calendar-min.js"></script>
<script type="text/javascript" src="../module/inventory/scripts/index.js"></script>
<script type="text/javascript">
    $(function(){
        /* 全选 */
         $('.checkall').click(function(){
            var _self = this;
            $('.checkitem').each(function(){
                if (!this.disabled)
                {
                	console.log(_self.checked);
                    $(this).attr('checked', _self.checked);
                }
            });
            $('.checkall').attr('checked', this.checked);
        });
    });
</script>
</head>
<body>
	<div class="container">
	    <div class="flow">
	        <div class="itemtitle">
	            <h3>图片标签列表</h3>
	        </div>
	    </div>
	    
	    <div class="h35"></div>
	    
	    <form action="" method="get">
	    <input type="hidden" name="m" value="sns">
	    <input type="hidden" name="s" value="sns_pic_tags.php">
	    <table class="select_table">
	        <tbody>
	            <tr>
	                <td width="60">发布时间:</td>
	                <td class="yui-skin-sam" width="150">
	                	<input style="width:70px;" id="sdate" name="sdate" type="text" size="12" value="<{$smarty.get.sdate}>" onfocus="lockinput(this)" />
	                	<input style="width:70px;" id="edate" name="edate" type="text" size="12" value="<{$smarty.get.edate}>" onfocus="lockinput(this)" />
	            		<div id="calContainer" style="display:none; position:absolute;"></div>
            		</td>
	                <td width="60">会员名称:</td>
	                <td width="100"><input id="username" type="text" name="username" class="w100" value="<{$smarty.get.username}>" /></td>
	                <td width="20">标签:</td>
	                <td width="100"><input id="tagname" type="text" name="tagname" class="w100" value="<{$smarty.get.tagname}>" /></td>
	                <td width="20">品牌:</td>
	                <td width="100">
	                	<input type="hidden" name="brandid" class="brandid" value="<{$smarty.get.brandid}>"/>
	                	<input style="width:150px;" type='text' name='brand' class='brands' value="<{$smarty.get.brand}>" placeholder='输入搜索词' autocomplete="off"/>
	            		<ul class="brandlist" style="display:none;position:absolute;background-color:#fff;border: 1px solid rgb(207, 201, 201);width: 150px;">
	        			</ul>
	                </td>
                </tr>
                <tr>
	                <td width="20">状态:</td>
	                <td width="30">
	                	<select name="status">
	                		<option value="">全部</option>
	                		<option value="-1" <{if '-1'==$smarty.get.status}>selected<{/if}>>已删除</option>
	                		<option value="0" <{if '0'==$smarty.get.status}>selected<{/if}>>已禁用</option>
	                		<option value="1" <{if '1'==$smarty.get.status}>selected<{/if}>>正常显示</option>
	                	</select>
	                </td>
	                <input type="hidden" id="order" name="" value="" />
	                <td><input id="search" type="image" src="<{$config.weburl}>/image/admin/search.gif" /></td>
	            </tr>
	            
	        </tbody>
	    </table>
	    </form>
	
		<form action="" name="snsform" method="get">
		<input type="hidden" name="m" value="sns">
	    <input type="hidden" name="s" value="sns_pic_tags.php">
	    <table class="table product">
	        <tbody>
	            <tr class="header">
	                <th width="20"><input type="checkbox" class="checkall" ></th>
	                <th width="50">标签ID</th>
	                <th width="100">标签名称</th>
	                <th width="50">分享ID</th>
	                <th width="50">会员ID</th>
	                <th width="100">会员名称</th>
	                <th width="50">品牌ID</th>
	                <th width="100">品牌名称</th>
	                <th width="50"><a href="javascript:doorder('timeorder','<{if $smarty.get.timeorder==desc}>asc<{else}>desc<{/if}>');">发布时间</a></th>
	                <th width="100">状态</th>
	            </tr>
	            <{foreach item=list from=$de.list}>
	            <tr>
	                <td><input type="checkbox" value="<{$list.id}>" class="checkitem" name="chk[]"></td>
	                <td><{$list.tag_id}></td>
	                <td><{$list.tag_name}></td>
	                <td><{$list.sns_id}></td>
	                <td><{$list.member_id}></td>
	                <td><{$list.username}></td>
	                <td><{$list.brandid}></td>
	                <td><{$list.brand}></td>
	                <td><{$list.create_time}></td>
	                <td>
	                <{if '-1'==$list.status}>已删除<{/if}>
	                <{if '0'==$list.status}>已禁用<{/if}>
	                <{if '0'<$list.status}>正常显示<{/if}>
	                </td>
	            </tr>
	            <{foreachelse}>
	            <tr>
	                <td class="norecord" colspan="99"><i></i><span>暂无符合条件的数据记录</span></td>
	            </tr>
	            <{/foreach}>
	        </tbody>
	        <tfoot>
	            <tr>
	                <td colspan="99">
	                	状态设置:
	                	<select name="set_status">
	                		<option value="">--请选择--</option>
	                		<option value="-1" >删除</option>
	                		<option value="0" >禁用</option>
	                		<option value="1" >正常</option>
	                	</select>
	                	<!-- 批量修改标签名:
	                	<input type="text" name="changeTagName" value=""/> -->
		                <input type="hidden" name="act" value="op" />
	                    <input type="submit" value="提交" />
	                	<div class="page"><span style="float:left;line-height: 20px;"><{if $countpro}>共有<{$countpro}>条记录<{/if}></span><{$de.page}></div>
	                </td>
	            </tr>
	        </tfoot>
	    </table>
    </form>
   </div> 
</body>
<script>
$(function(){
    //默认待选品牌
    $('.brands').bind('click',function(e){
            $.get('<{$config.weburl}>/admin/module.php?m=activity&s=activity.php&operation=getbrand&brandname=',function(data){
                $('.brandlist').show();
                $('.brandlist').html(""+data);
            });
    });
    //直接搜品牌
    $('.brands').bind('input',function(e){
        var value=$(this).val();
        if(value==''){
            $('.brandlist').hide();
            return ;
        }
        else{
            $.get("<{$config.weburl}>/admin/module.php?m=activity&s=activity.php&operation=getbrand&brandname="+value,function(data){
                $('.brandlist').show();
                $('.brandlist').html(""+data);
            });
        }
    });
    $('body').bind('click',function(e){
        $('.brandlist').hide();
    });
    $('.brandlist').delegate('li','click',function(){
        var _this=$(this);
        var brandName=_this.text();
            var brandId=_this.attr('bid');
            $('.brands').val(brandName);
            $('.brandid').val(brandId);
            $('.brandlist').hide();
    });
});
//保存标题
/**function saveTagName(tagId){
	if(tagId>0){
		var tagname = $('#tagname_'+tagId).val();
		$.ajax({
		url:'<{$config.weburl}>/admin/module.php?m=sns&s=sns_pic_tags.php',
		data:'tagid='+tagId+'&tagname='+tagname+'&act=saveTagName',
		type:'post',
		success:function(s){
   			
   		}
		});
	}
}**/
//排序
function doorder(key,value){
	var order = $('#order');
	order.attr('name',key);
	order.attr('value',value);
	
	$('#search').trigger('click');
}
</script>
</html>